package day1206zy.day1206zy123;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class demo2 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        Class<?> clazz = Class.forName("day1206zy123.Student");
        Constructor<?> c = clazz.getDeclaredConstructor(String.class);
//        类外一次可见
        c.setAccessible(true);
         c.newInstance("123");

    }
}
